<template>
  <div>
    <el-dialog
      title="公告"
      :visible.sync="projectDataSummary"
      width="40%"
      center
      :close-on-click-modal="false"
    >
      <el-scrollbar style="height: 320px">
        <div v-for="item in list" :key="item.id" class="box">
          <div class="hadeBox">
            <span>
              <span style="font-size: 15px"></span>
              <span> {{ item.noticeName }}</span>
            </span>
          </div>
          <div class="textBox">
            <span>{{ item.text }}</span>
          </div>
          <div class="hadeText">
            <span style="font-size: 15px"></span>
            <span>{{ item.cTime }}</span>
          </div>
        </div>
        <!-- <h2>{{ num }}</h2> -->
      </el-scrollbar>
      <div slot="footer">
        <el-button @click="projectDataSummary = false" type="primary"
          >我知道了</el-button
        >
      </div>
      <!-- <h2>222222</h2> -->
    </el-dialog>
  </div>
</template>
<script>
import { MenuPop } from "@/api/system/index.js";
export default {
  props: ["uelLocation", "configTypeId", "proId"],
  components: {},
  data() {
    return {
      list: [],
      projectDataSummary: false,
    };
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {
    // this.gitData();
    // this.components=true;
  },
  methods: {
    async gitData() {
      // this.$emit('AddAnnouncement');
      this.$nextTick(async () => {
        let param = {
          tenantId: sessionStorage.getItem("TenantId") - 0, //租户ID
          type: "PC", //PC和APP
          route: this.uelLocation, //路径
          proId: this.proId, //项目ID
          configTypeId: this.configTypeId, //项目数据展示里面的configTypeId
        };

        const data = await MenuPop(param);
        if (data.code == 200 && data.data.length > 0) {
          this.projectDataSummary = true;
          this.list = data.data;
        }
        //console.log(data, "公告弹窗参数");
      });
    },

    handelConfirm() {
      this.$refs["elForm"].validate((valid) => {
        if (!valid) return;
        this.close();
      });
    },
  },
};
</script>
<style>
body .el-scrollbar__wrap {
  overflow-x: hidden;
  /* //隐藏横向滚动条   */
}

/* 但是隐藏横向滚动条样式会导致element 下拉框最后一位显示不完整，为了避免这个问题，再加上 */
.el-select-dropdown .el-scrollbar .el-scrollbar__wrap {
  overflow: scroll !important;
}
</style>
<style scoped lang="scss">
::v-deep .el-dialog__wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}
::v-deep .el-dialog:not(.is-fullscreen) {
  margin-top: 0vh !important;
}
.box {
  // border: 1px red solid;
  padding-bottom: 10px;
  // border-bottom: 1px rgb(104, 104, 104) solid;
  margin-bottom: 10px;
  .hadeBox {
    //  border: 1px red solid;
    display: flex;
    flex-direction: column;
    color: rgb(0, 0, 0);
  }
  .hadeText {
    padding-bottom: 10px;
    border-bottom: 1px #eee solid;
    color: rgb(0, 0, 0);
  }
  .textBox {
    margin-top: 5px;
    // border:1px rgb(182, 182, 182) dashed;
    border-radius: 7px;
    padding: 10px 0px;
    color: rgb(153, 153,153);
  }
}
</style>
